home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / trial.doc < prev    next >
Text File  |  1995-03-31  |  4KB  |  86 lines

  1. Article: 4997 of comp.sys.handhelds 
  2. From: kskalb@faui1f.informatik.uni-erlangen.de (Klaus Kalb) 
  3. Subject: HP48: Factoring Integers 
  4. Date: 21 Dec 90 15:36:54 GMT 
  5.  
  6. This routine factors integers into primes. 
  7. The program does trial division by all numbers that 
  8. are not true multiples of 2,3,5 or 7. 
  9. The main work is done in mcode, so it is fast. 
  10. You need ASC\-> to install it.  [No you don't.  Already installed.  -jkh-] 
  11.  
  12. Happy Christmas and a merry new year, 
  13. -KK 
  14.  
  15. --------------------------------------------------------------------- 
  16.                          Author 
  17. --------------------------------------------------------------------- 
  18.  
  19.   Mail any suggestions or comments to 
  20.  
  21.                  kskalb@informatik.uni-erlangen.de 
  22.  
  23. --------------------------------------------------------------------- 
  24.                          Usage 
  25. --------------------------------------------------------------------- 
  26.  
  27.     Input: 
  28.       Level 2: Number n to be factored (binary or real; n < 2^63) 
  29.       Level 1: Bound  b (binary or real; b < 2^20) 
  30.  
  31.     Output: 
  32.       Level 1: List of Factors  
  33.  
  34. If the program is sure that all numbers in the output list are indeed 
  35. primes, the list will be tagged with a plus-sign. 
  36.  
  37. If the tag is missing, the last entry in the list might not be a prime. 
  38.  
  39. All divisors t of n with t<=b will be found. 
  40.  
  41. The entries in the result will be real, unless they are greater than 2^39. 
  42. Note that this can only happen to the last number in the list. 
  43.  
  44. [Note: See FACTOR for application of Klaus' code.  -jkh-] 
  45.  
  46. --------------------------------------------------------------------- 
  47.                          Installation 
  48. --------------------------------------------------------------------- 
  49.  
  50. [Note! This applies ONLY to the original source code, TRIAL.SRC; the TRIAL 
  51.  program on the disk is already "installed" and may be used directly, so you 
  52.  may ignore what follows.  -jkh-] 
  53.  
  54.   -- Download the following program to your HP48. 
  55.   -- Be sure that ASC/-> is accessible. 
  56.   -- Evaluate the downloaded object. 
  57.   -- A program named 'TRIAL' will appear on the current directory. 
  58.  
  59.  
  60. --------------------------------------------------------------------- 
  61.                          Warning 
  62. --------------------------------------------------------------------- 
  63.  
  64.   The program 'TRIAL' contains a code object. 
  65.   To my knowledge, programs containing code object can't be 
  66.   edited on the HP48 by standard means, so don't try it. 
  67.  
  68. --------------------------------------------------------------------- 
  69.                          Disclaimer 
  70. --------------------------------------------------------------------- 
  71.  
  72.      This program makes use of undocumented low-level features of 
  73.      the HP48SX calculator, and may or may not cause loss of data, 
  74.      excessive battery drainage, and/or damage to the calculator 
  75.      hardware.  The Author takes no responsibility whatsoever for  
  76.      any damage caused by the use of this program. 
  77.  
  78.      This software is provided "as is" and WITHOUT ANY EXPRESS OR 
  79.      IMPLIED WARRANTIES, including, but not limited to, THE IMPLIED 
  80.      WARRANTIES OF MERCHANTABILITY and FITNESS FOR A PARTICULAR PURPOSE. 
  81.  
  82. ------------------------------------------------------------------------------ 
  83.    Klaus Kalb    | mail :  IMMD1 / Martenstr. 3 / W-8520 Erlangen / Germany    
  84.                  | email:  kskalb@immd1.informatik.uni-erlangen.de    
  85. ------------------------------------------------------------------------------ 
  86.